package 抽象数据类型;

public class ListNodeData implements Comparable<ListNodeData>{
    private float coef;
    private  int expn;

    public ListNodeData(float coef, int expn) {
        this.coef = coef;
        this.expn = expn;
    }

    public float getCoef() {
        return coef;
    }

    public void setCoef(float coef) {
        this.coef = coef;
    }

    public int getExpn() {
        return expn;
    }

    public void setExpn(int expn) {
        this.expn = expn;
    }

    @Override
    public int compareTo(ListNodeData o) {
        return this.getExpn() > o.getExpn() ? 1 : (this.getExpn() < o.getExpn() ? -1 : 0);
    }

    @Override
    public String toString() {
        return "{" +
                "coef=" + coef +
                ", expn=" + expn +
                '}';
    }
}
